#pragma once
#include <string>
#include <vector>
#include "PDTNodeDefs.h"



//#define LEFT 0
//#define RIGHT 1
//:% s/class \([^; {:]*\).*/\1_Em,
class PDTCodeGraph;
class PDTGraphVisitor;

class PDTNode{
protected:


	NodeId id;
public:   	
	vector<PDTNode*> parents;
	vector<PDTNode*> children;
	vector<PDTNode*> writers;
	vector<PDTNode*> readers;

	NodeId getId();


	virtual vector<PDTNode*> *getWriters();
	virtual vector<PDTNode*> *getReaders();

	virtual void addWriter(PDTNode * writer);
	virtual void addReader(PDTNode * reader);

	virtual vector<PDTNode*> *getParents();
	virtual vector<PDTNode*> *getChildren();

	virtual void addParent(PDTNode* parent);
	virtual void addChild(PDTNode* child);


	virtual NodeTypeEnum getType()=0;
	PDTNode(PDTCodeGraph &CG);

	void traverse(PDTGraphVisitor &gv);
	virtual void printType(){cout<<"no";}

	virtual ~PDTNode();
	virtual bool isPDTNumVar(){return false;}
	virtual bool isPDTNumConstInt(){return false;}
	virtual bool isPDTNumConstDbl(){return false;}
	virtual bool isPDTBoolVar(){return false;}
	virtual bool isPDTBoolConst(){return false;}
	virtual bool isPDTAdd(){return false;}
	virtual bool isPDTSubt(){return false;}
	virtual bool isPDTMult(){return false;}
	virtual bool isPDTDiv(){return false;}
	virtual bool isPDTMod(){return false;}
	virtual bool isPDTAssign(){return false;}
	virtual bool isPDTIfElse(){return false;}
	virtual bool isPDTWhile(){return false;}
	virtual bool isPDTAnd(){return false;}
	virtual bool isPDTOr(){return false;}
	virtual bool isPDTLessThan(){return false;}
	virtual bool isPDTGreaterThan(){return false;}
	virtual bool isPDTEqualNum(){return false;}
	virtual bool isPDTEqualBool(){return false;}
	virtual bool isPDTNeg(){return false;}
	virtual bool isPDTNot(){return false;}
	virtual bool isPDTListOfStatements(){return false;}
	virtual bool isPDTLessThanEqual(){return false;}
	virtual bool isPDTGreaterThanEqual() {return false;}

};

